<?php

namespace app\admin\job;

use think\Exception;
use think\exception\ThrowableError;
use think\queue\Job;

/**
 * 处理分销任务
 */
class TestJob extends BaseJob
{
    /**
     * 分销商升级
     *
     * @param Job $job      当前的任务对象
     * @param int $userId   升级用户ID  
     */
    public function orderJob(Job $job, $data)
    {
        try{
            file_put_contents("job.txt",date("Y-m-d H:i:s").$job->getName()."\r\n",FILE_APPEND);
        }catch (ThrowableError $e){
            file_put_contents("queueerror.txt",$e->getMessage());
        }
        $job->delete();
    }
}